#!/bin/sh
wget -N -c http://117.48.234.190:4000/qemu-4.0.0-1.el7.x86_64.rpm
rpm -ivh qemu-4.0.0-1.el7.x86_64.rpm
qver=`/usr/libexec/qemu-kvm --version | grep version | awk '{print $4}' | awk -F"[()]" '{print $1}'`
mv /usr/libexec/qemu-kvm /usr/libexec/qemu-kvm-$qver
ln -s /usr/local/qemu-4.0.0/bin/qemu-system-x86_64 /usr/libexec/qemu-kvm
mv /usr/bin/qemu-img /usr/bin/qemu-img-$qver
ln -s /usr/local/qemu-4.0.0/bin/qemu-img /usr/bin/qemu-img
mv /usr/bin/qemu-io /usr/bin/qemu-io-$qver
ln -s /usr/local/qemu-4.0.0/bin/qemu-io /usr/bin/qemu-io
mv /usr/bin/qemu-nbd /usr/bin/qemu-nbd-$qver
ln -s /usr/local/qemu-4.0.0/bin/qemu-nbd /usr/bin/qemu-nbd
systemctl stop libvirtd
systemctl start libvirtd
